package com.mashensoft;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class LabelDemoAction extends ActionSupport {
	String name;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String execute() throws Exception {
		ActionContext.getContext().getValueStack().set("userName", "xiaoming");
		ActionContext.getContext().put("password", "123");
		ServletActionContext.getRequest().setAttribute("company", "mashen");
		ActionContext.getContext().getSession().put("school", "北大");
		if(ActionContext.getContext().getApplication().get("num")!=null){
			int num = (Integer) ActionContext.getContext().getApplication().get("num");
			num+=1;
		}else {
			ActionContext.getContext().getApplication().put("num", 100);
		}
		return super.execute();
	}
}
